<?php

namespace App\Http\Traits;

trait DelayTask {
    public function delayTask(string $callbackUrl = '', int $second = 0) {
        if(!$second) {
            return false;
        }

        $taskServerUrl = env('TASK_URL');
        $taskUrl =  env('APP_URL').$callbackUrl;
        return curlRequest($taskServerUrl, ['task_timestamp'=> $second, 'task_url'=>urlencode($taskUrl)], false, [], 1);
    }
}